home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ccdl150l.zip / IO / WRITEBUF.C < prev   
C/C++ Source or Header  |  1996-07-26  |  396b  |  19 lines

  1. #include <stdio.h>
  2.  
  3. int _writebuf(FILE *stream)
  4. {
  5.     if ((stream->flags & _F_IN) || (( stream->flags & _F_OUT) && stream->curp >=stream->bsize + stream->buffer)) {
  6.         if (fflush(stream))
  7.             return EOF;
  8.         goto join;
  9.     }
  10.     else {
  11.         if (!(stream->flags & _F_OUT)) {
  12. join:
  13.             stream->flags &= ~(_F_IN | _F_OUT);
  14.             stream->level = 0;
  15.             stream->curp = stream->buffer;
  16.         }
  17.     }
  18.     return 0;
  19. }